parforclangfandomcom-20200215-history
ParFor Clang Wiki
Parallel For In Clang For LLVM For some reason creating a page does not automatically create a link on the main site so if somebody makes a page add a link to the main page so that it is easy to get to. Make a page for your group and post the link here ? Group: Naveen And Dmitri Group: Dan and co Group: Abbas, Avinash, Codrut, Satya List of file changes: Here is the list of files that Dan and his group modified: (FILES ARE UP!) *NOTE: I've copy-pasted the text from each file into a page of the same name, since the wiki doesn't allow uploads of all file extensions. Though I think this will make it easier to share future changes as well. When I was editing, I was just marking all my changes with comments containing a bunch of D's. So to find the changes just search for a bunch of D's in a row, like "DDDDDDD". *Copy pasta on how to print from the AST: **Pretty printing from the AST: **Note, the -cc1 argument indicates the the compiler front-end, and not the driver, should be run. The compiler front-end has several additional Clang specific features which are not exposed through the GCC compatible driver interface. **$ clang -cc1 filename -ast-print *Pretty printing from the CFG **$ clang -cc1 -analyze -cfg-dump filename *All changed files have been added to Category:ChangedFiles. If you find more files which have to be changed, add a link to this list and please add the category link to the file. *GETTING PARFOR INTO THE AST **DeclSpec.h **ParseObjC.cpp **ParseStmt.cpp **Parser.h **RecursiveASTVisitor.h **Sema.h **SemaCodeComplete.cpp **SemaStmt.cpp **SemaType.cpp **Stmt.cpp **Stmt.h **StmtPrinter.cpp **StmtProfile.cpp **Stmtnodes.inc **TokenKinds.def **TreeTransform.h *GETTING PARFOR INTO THE CFG **Note: I'm sure some of these are unnecessary, but I'm not sure which ones, and it works now, so... **CFG.cpp **ASTReaderStmt.cpp **ASTWriterStmt.cpp **CIndex.cpp **ASTBitCodes.cpp **CFGRecStmtVisitor.h **CodeGenFunction.h **CodeGenFunction.cpp **CGStmt.cpp **CoreEngine.cpp **ExprEngine.cpp **ParentMap.cpp **RewriteObjC.cpp **StmtXML.def I've asked Dan to post the actual files themselves. Once the files are posted, I would recommend installing the updated files and seeing if the changes are complete. Then, given an input program with a parfor loop, dump the IR and confirm that it contains now contains a "parfor" ﻿loop. [ Can someone post how to dump the IR, i.e. what flag is used? ] Once the IR contains parfor, the next step is to translate the IR into two for loops, the first creating and starting the threads, and the second joining the threads. CLANG PLUGIN ARCHITECTURE I tried to get the Clang plugin architecture to work but it doesn't seem to be stable. There's a brief tutorial here which references files which are not included in our builds. I found what I assume is a valid copy of PrintFunctionNames.cpp here, but there are build errors when trying to use it. A possible explanation for this behaviour may be this, but I didn't want to go messing around with the makefiles. If someone is up to it, this might still be a good approach, but it's also reputed to be an unstable part of Clang so who knows. Millerdj 23:12, March 1, 2011 (UTC) Category:ChangedFiles Category:ChangedFiles Category:Browse